Query List 41 to 45

Query List

41. List the employees who joined on 25-JAN-81, 09-MAY-81, 05-NOV-81, 04- JUN-80 in asc order of seniority. 

 Query:

Select * from employee where hire_date in ('25-JAN-81', '09-MAY-81', '05-NOV81', '04-JUN-80') order by hire_date asc; 

Output:

42. List the employees who are joined in the month of Jan 1982. 

Query: 

Select * from employee where hire_date between '01-Jan-82' and '31-Jan-82'; 

(OR) 

Query: 

Select * from employee where to_char(hire_date, 'mon-yyyy') ='jan-1982'; 

Output:


43. List the Enames those are starting with ‘A’ and with five characters. 

 Query: 

Select ename from employee where ename like 'A%' and length (ename) = 5; 

Output: 


44. List the emps those are having six chars and fourth character must be ‘e’.

 Query: 

Select * from employee where length(ename) = 6 and ename like '___e%'; 

 Output:



45. List the six character names starting with ‘R’ and ending with ‘h’.

 Query: 

Select * from employee where length(ename) = 6 and ename like ‘R%h’; 

 Output: 












Post a Comment

© DBMS. The Best Codder All rights reserved. Distributed by